package com.gzsj.genealogyManagement.people.domin;


import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public class People   implements Comparable<People> {

    // id起始族人
    private  String id;
    private  String idPath;
    private  String parentPath;
    private  String avatar;
    private  String village;
    private  String  villageFirst;
    private  String  roomId;
    private  String  roomFirst;
    private  String  room;
    private  String  roomThree;
    private  String roomPath;
    private  String parentId;
    private  String parentName;
    private  String parentSpouseId;
    private  String parentSpouseName;
    private  String level;

    // 族谱id
    private  String tableId;


    private  String gender;
    private  String  name;
    private  String life;
    private  String star;
    private  String marry;
    private  String biography;
    private  String biographyHtml;
    private  String isSpouse;
    private  String spouseId;
    private  String spouseName;


    private String createTime;

    private List<People> children;



    private String deleteTime;

    // 0横版  1竖版
    private String type;

    // 起始页码
    private String startPage;


    // 起始世代
    private String start;


    // 结束世代
    private String end;





    public People(){
        this.children = new ArrayList<>();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getIdPath() {
        return idPath;
    }

    public void setIdPath(String idPath) {
        this.idPath = idPath;
    }

    public String getParentPath() {
        return parentPath;
    }

    public void setParentPath(String parentPath) {
        this.parentPath = parentPath;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getVillage() {
        return village;
    }

    public void setVillage(String village) {
        this.village = village;
    }

    public String getVillageFirst() {
        return villageFirst;
    }

    public void setVillageFirst(String villageFirst) {
        this.villageFirst = villageFirst;
    }

    public String getRoomId() {
        return roomId;
    }

    public void setRoomId(String roomId) {
        this.roomId = roomId;
    }

    public String getRoomFirst() {
        return roomFirst;
    }

    public void setRoomFirst(String roomFirst) {
        this.roomFirst = roomFirst;
    }

    public String getRoom() {
        return room;
    }

    public void setRoom(String room) {
        this.room = room;
    }

    public String getRoomThree() {
        return roomThree;
    }

    public void setRoomThree(String roomThree) {
        this.roomThree = roomThree;
    }

    public String getRoomPath() {
        return roomPath;
    }

    public void setRoomPath(String roomPath) {
        this.roomPath = roomPath;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public String getParentSpouseId() {
        return parentSpouseId;
    }

    public void setParentSpouseId(String parentSpouseId) {
        this.parentSpouseId = parentSpouseId;
    }

    public String getParentSpouseName() {
        return parentSpouseName;
    }

    public void setParentSpouseName(String parentSpouseName) {
        this.parentSpouseName = parentSpouseName;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public String getTableId() {
        return tableId;
    }

    public void setTableId(String tableId) {
        this.tableId = tableId;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLife() {
        return life;
    }

    public void setLife(String life) {
        this.life = life;
    }

    public String getStar() {
        return star;
    }

    public void setStar(String star) {
        this.star = star;
    }

    public String getMarry() {
        return marry;
    }

    public void setMarry(String marry) {
        this.marry = marry;
    }

    public String getBiography() {
        return biography;
    }

    public void setBiography(String biography) {
        this.biography = biography;
    }

    public String getBiographyHtml() {
        return biographyHtml;
    }

    public void setBiographyHtml(String biographyHtml) {
        this.biographyHtml = biographyHtml;
    }

    public String getIsSpouse() {
        return isSpouse;
    }

    public void setIsSpouse(String isSpouse) {
        this.isSpouse = isSpouse;
    }

    public String getSpouseId() {
        return spouseId;
    }

    public void setSpouseId(String spouseId) {
        this.spouseId = spouseId;
    }

    public String getSpouseName() {
        return spouseName;
    }

    public void setSpouseName(String spouseName) {
        this.spouseName = spouseName;
    }

    public List<People> getChildren() {
        return children;
    }

    public void setChildren(List<People> children) {
        this.children = children;
    }


    public void addChild(People child) {
        this.children.add(child);
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getDeleteTime() {
        return deleteTime;
    }

    public void setDeleteTime(String deleteTime) {
        this.deleteTime = deleteTime;
    }


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }


    public String getStartPage() {
        return startPage;
    }

    public void setStartPage(String startPage) {
        this.startPage = startPage;
    }

    public String getStart() {
        return start;
    }

    public void setStart(String start) {
        this.start = start;
    }

    public String getEnd() {
        return end;
    }

    public void setEnd(String end) {
        this.end = end;
    }

    // 从小至大排序
    @Override
    public int compareTo(People o) {
        int parentPathComparison = this.parentPath.compareTo(o.getParentPath());
        if (parentPathComparison != 0) {
            return parentPathComparison;
        }
        return this.createTime.compareTo(o.getCreateTime());
    }

    @Override
    public String toString() {
        return "People{" +
                "id='" + id + '\'' +
                ", idPath='" + idPath + '\'' +
                ", parentPath='" + parentPath + '\'' +
                ", avatar='" + avatar + '\'' +
                ", village='" + village + '\'' +
                ", villageFirst='" + villageFirst + '\'' +
                ", roomId='" + roomId + '\'' +
                ", roomFirst='" + roomFirst + '\'' +
                ", room='" + room + '\'' +
                ", roomThree='" + roomThree + '\'' +
                ", roomPath='" + roomPath + '\'' +
                ", parentId='" + parentId + '\'' +
                ", parentName='" + parentName + '\'' +
                ", parentSpouseId='" + parentSpouseId + '\'' +
                ", parentSpouseName='" + parentSpouseName + '\'' +
                ", level='" + level + '\'' +
                ", tableId='" + tableId + '\'' +
                ", gender='" + gender + '\'' +
                ", name='" + name + '\'' +
                ", life='" + life + '\'' +
                ", star='" + star + '\'' +
                ", marry='" + marry + '\'' +
                ", biography='" + biography + '\'' +
                ", biographyHtml='" + biographyHtml + '\'' +
                ", isSpouse='" + isSpouse + '\'' +
                ", spouseId='" + spouseId + '\'' +
                ", spouseName='" + spouseName + '\'' +
                ", createTime='" + createTime + '\'' +
                ", children=" + children +
                ", deleteTime='" + deleteTime + '\'' +
                ", type='" + type + '\'' +
                ", startPage='" + startPage + '\'' +
                ", start='" + start + '\'' +
                ", end='" + end + '\'' +
                '}';
    }



}


